<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>综合数据表</title>
    <!--    <script type="text/javascript" src="../static/echarts.min.js"></script>-->
    <script src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <!--    <script type="text/javascript" src="static/jquery.min.js"></script>-->
    <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
<div>
    <label>输入股票代码：</label>
    <input type="text" style="width: 200px" id="dCode" name="dCode"/>
    <label>输入股票名称：</label>
    <input type="text" style="width: 200px" id="dName" name="dName"/>
    <input type="button" value="查询" onclick="toQuery()"/>
    <!--    <select th:field="*{stockInfos}">-->
    <!--        <option value=""></option>-->
    <!--        <option th:each="stockInfo: ${stockInfos}" th:value="${stockInfo.getdCode()}" th:text="${stockInfo.getdName()}" class="p1"></option>-->
    <!--    </select>-->
</div>
<div id="myEchart1" style="width:1800px;height:800px;">
</div>
</body>
<script type="text/javascript">
    let myEchart1 = echarts.init(document.getElementById('myEchart1'));

    function toQuery() {

        let dCode = $("#dCode").value();
        let dName = $("#dName").value();
        alert("---------------" + dCode + "   " + dName)
        $.ajax({
            url: "${pageContext.request.contextPath}/stockInfo/toQuery",
            dataType: 'json',
            data: {
                'dCode': dCode,
                'dName': dName
            },
            success: function (data) {
                console.log(data)
            }
        });
    }


    myEchart1.setOption(option);
</script>
</html>